﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Medical.Domain.BasicManagement;
using Medical.Api.Read.Application.Command.BasicManagement.ShelfDictionaryCommand;
using Medical.Interstructrue.Base;

namespace Medical.Api.Read.Service.BasicManagement
{
    public class BasicManagementService : IBasicManagementService
    {
        private readonly IBaseRepository<Shelves> _shelvesRepository;
        public BasicManagementService(IBaseRepository<Shelves> shelvesRepository)
        {
            _shelvesRepository = shelvesRepository;
        }
        public async Task<List<ShelvesListDto>> GetShelvesListAsync()
        {
            var list = _shelvesRepository.GetAll().Select(x => new ShelvesListDto
            {
                Id = x.Id,
                ShelfName = x.ShelfName
            }).ToList();
            return await Task.FromResult(list);
        }
    }
}
